<template>
	<view style="background: rgba(0,0,0,0); width: 100%; height: 100vh;">
		<uni-popup type="bottom" ref="pay" :is-mask-click="false">
			<view class="popup">
				<view class="title">
					为什么要支付
				</view>
				<view class="tip">
					为过滤非诚意用户，避免微商，酒托，广告等骚扰，打造纯净私密的交友空间，保证产品持续稳定运营。需支付一定费用，成为会员
				</view>
				<view class="price">
					￥{{ticketPrice}}
				</view>
				<view class="type" v-for="(item, index) in payTypes" :key="index" @click="onItemPay(index)">
					<image :src="item.icon"></image>
					<view class="tip">{{item.title}}</view>
					<zy-checkbox :checked="item.checked"></zy-checkbox>
				</view>
				<view>
					<zy-button text='确定支付' @click.native="requestPay"></zy-button>
				</view>
			</view>
		</uni-popup>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				payTypes: [{
						payType: 1,
						icon: this.getImageUrl('pay_alipay.png'),
						title: '支付宝支付',
						checked: false
					},
					{
						payType: 2,
						icon: this.getImageUrl('pay_wechat.png'),
						title: '微信支付',
						checked: false
					},
				],
				payType: '',
				projectId: 4,
				ticketPrice: '28',
			}
		},
		onShow() {
			setTimeout(() => {
				this.$refs.pay.open()
			}, 1000)
		},
		// onBackPress() {
		// 	return true
		// },
		methods: {

		}
	}
</script>
<style>
	page {
		/* 必须的样式，这是页面背景色为透明色 */
		background: transparent;
	}
</style>
<style lang="scss" scoped>
	.popup {
		display: flex;
		flex-direction: column;
		justify-content: center;
		background-color: white;
		border-top-left-radius: 30rpx;
		border-top-right-radius: 30rpx;
		width: 100wh;
		height: 550rpx;
		padding: 30rpx;

		.title {
			font-size: 36rpx;
			color: #222;
			line-height: 60rpx;
			height: 60rpx;
			text-align: center;
		}

		.tip {
			font-size: 20rpx;
			color: #888;
		}

		.price {
			font-size: 50rpx;
			color: mediumvioletred;
			text-align: center;
		}

		.type {
			flex: 1;
			display: flex;
			flex-direction: row;
			align-items: center;
			width: 100%;
			height: 100rpx;
			font-size: 28rpx;
			color: #222;

			image {
				width: 60rpx;
				height: 60rpx;
				border-radius: 50%;
				margin-right: 20rpx;
			}

			.tip {
				font-size: 28rpx;
				color: #555;
				flex: 1;
				text-align: left;
			}

		}
	}
</style>